$(function(){
	//alert('111');
	$("#file_upload").uploadify({
		buttonText:'上传文件',
		auto:true,
		progressData:'speed',
		multi:false,
		height:20,
		width:55,
		overrideEvents:['onDialogClose'],
		fileTypeDesc:'文件格式:',
		queueID:'instructionfile',
		fileTypeExts:'*.xlsx;',
		fileSizeLimit:'15MB',
		swf:'plug-in/uploadify/uploadify.swf',	
		uploader:'uploadEngineerController.do?importExcel',
		onUploadStart : function(file) { 
			var documentTitle=$('#documentTitle').val();
			$("b").append("正在导入.......");
			$('#file_upload').uploadify("settings", 
					"formData", 
					{'documentTitle':documentTitle});$('#file_upload').fadeOut();} ,
					onQueueComplete : function(queueData) { },
					onUploadSuccess : function(file, data, response) {
						var da2 = JSON.parse(data);
						if(da2){
							$("b").hide();
							parent.window.tip(da2.msg);
							frameElement.api.reload(win,"zyEngineerController.do?zyEngineer");
							frameElement.api.close();
						}
						/* var da = JSON.parse(data);
						var t = $("#tb_archiveT tr").length;
			    		var newTr = "<tr>";
			    		newTr+="<td class='bulecolor'>"+(t-2)+"</td>";
			    		newTr += "<td><input type='text' name='docFileName' style='width:200px' readonly='readonly' value='"+da.attributes.fileName+"' /></td>";
			    		newTr += "<td>"+fileType+"</td>";
						newTr += "<td><input type='text' name='docFileRemark' style='width:320px' /></td>";
						newTr += "<td><input type='checkbox' name='docIsMain' /></td>";
						newTr += "<td><input type='hidden' name='docId' value="+da.attributes.fileId+" /><a href='javascript:void(0);' onclick='delArchiveRow(this)'>删除</a></td>";
						newTr += "</tr>";
			    		$("#tb_archive").before(newTr); */
					},onFallback : function(){
						tip("您未安装FLASH控件，无法上传图片！请安装FLASH控件后再试")
					},onSelectError : function(file, errorCode, errorMsg){
						switch(errorCode) {
							case -100:
								tip("上传的文件数量已经超出系统限制的"+$('#instruction').uploadify('settings','queueSizeLimit')+"个文件！");
								break;
							case -110:
								tip("文件 ["+file.name+"] 大小超出系统限制的"+$('#instruction').uploadify('settings','fileSizeLimit')+"大小！");
								break;
							case -120:
								tip("文件 ["+file.name+"] 大小异常！");
								break;
							case -130:
								tip("文件 ["+file.name+"] 类型不正确！");
								break;
							}
					},onUploadProgress : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { }});
	} );